package org.example.service.impl;

import org.example.component.TransactionManagerHandler;
import org.example.pojo.User;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService {

    @Override
    public void insert(User user) {
        System.out.println("调用Mapper 扣小A的钱 1000元");
//            System.out.println(1/0);//模拟程序异常
        System.out.println("调用Mapper 给小A女朋友打钱1000元");
    }

    @Override
    public void update(User user) {
        System.out.println("调用Mapper的update");
    }

    @Override
    public void delete(Integer id) {
        System.out.println("调用Mapper的delete");
    }

    @Override
    public User getById(int id) {
        System.out.println("UserServiceImpl.getById");
        return new User();
    }
}
